/**
 *  存放 tabbar数据
 * **/
import * as types from '../mutation-type';
const state = {
	name: "",
	tabbarList: [{
			iconPath: "home",
			selectedIconPath: "home-fill",
			text: '首页',
			count: 1,
			isDot: true,
			pagePath: "/pages/home/index"
		},
		{
			iconPath: "/static/images/home/电商.png",
			selectedIconPath: "/static/uview/example/component_select.png",
			text: '电商',
			count: 2,
			isDot: true,
			pagePath: "/pages/index/index"
		},
		{
			iconPath: "/static/uview/example/js.png",
			selectedIconPath: "/static/uview/example/js_select.png",
			text: '发布',
			midButton: true,
			pagePath: "/pages/js/index"
		},
		{
			iconPath: "/static/images/home/信息.png",
			selectedIconPath: "/static/uview/example/template_select.png",
			text: '消息',
			pagePath: "/pages/template/index"
		},
		{
			iconPath: "account",
			selectedIconPath: "account-fill",
			text: '个人中心',
			pagePath: "/pages/center/index"
		},
	]
}
// getters
const getters = {
	userInfo(state) {
		return state.name;
	},
};

// actions
// 异步方法用actions
// actions不能直接修改全局变量，需要调用commit方法来触发mutation中的方法
const actions = {
	login(context, payload) {
		context.commit('login', payload);
	},

};

// mutations
const mutations = {};

export default {
	namespaced: true,
	state,
	getters,
	actions,
	mutations,
};
